From: Keir Fraser Date: Mon, 9 Mar 2009 15:01:34 +0000 (+0000) Subject: xentrace: trace when we continue with the same task X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~13994^2 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=9c3f0a9659ac5952d786dcf3ddbf67e732d21a65;p=xen.git xentrace: trace when we continue with the same task Trace when the scheduler decides to continue running the same process. This lets us see that this is happening for one; it also lets us see domains in a trace which are actively running on pcpu but never scheduled out. Signed-off-by: George Dunlap --- diff --git a/xen/common/schedule.c b/xen/common/schedule.c index aed123b2af..99f57a232d 100644 --- a/xen/common/schedule.c +++ b/xen/common/schedule.c @@ -81,6 +81,20 @@ static inline void trace_runstate_change(struct vcpu *v, int new_state) __trace_var(event, 1/*tsc*/, sizeof(d), (unsigned char *)&d); } +static inline void trace_continue_running(struct vcpu *v) +{ + struct { uint32_t vcpu:16, domain:16; } d; + + if ( likely(!tb_init_done) ) + return; + + d.vcpu = v->vcpu_id; + d.domain = v->domain->domain_id; + + __trace_var(TRC_SCHED_CONTINUE_RUNNING, 1/*tsc*/, sizeof(d), + (unsigned char *)&d); +} + static inline void vcpu_runstate_change( struct vcpu *v, int new_state, s_time_t new_entry_time) { @@ -803,6 +817,7 @@ static void schedule(void) if ( unlikely(prev == next) ) { spin_unlock_irq(&sd->schedule_lock); + trace_continue_running(next); return continue_running(prev); } diff --git a/xen/include/public/trace.h b/xen/include/public/trace.h index e2d8adc7b4..83e09f3b59 100644 --- a/xen/include/public/trace.h +++ b/xen/include/public/trace.h @@ -60,7 +60,8 @@ #define TRC_TRACE_WRAP_BUFFER (TRC_GEN + 2) #define TRC_TRACE_CPU_CHANGE (TRC_GEN + 3) -#define TRC_SCHED_RUNSTATE_CHANGE (TRC_SCHED_MIN + 1) +#define TRC_SCHED_RUNSTATE_CHANGE (TRC_SCHED_MIN + 1) +#define TRC_SCHED_CONTINUE_RUNNING (TRC_SCHED_MIN + 2) #define TRC_SCHED_DOM_ADD (TRC_SCHED_VERBOSE + 1) #define TRC_SCHED_DOM_REM (TRC_SCHED_VERBOSE + 2) #define TRC_SCHED_SLEEP (TRC_SCHED_VERBOSE + 3)